-
Notifications
You must be signed in to change notification settings - Fork 5
feat: extract version bump logic into reusable script #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add .github/scripts/version-bump.sh with extracted logic from PR #137 - Add version-check.yaml workflow to verify module versions are updated - Add version-bump.yaml workflow that uses the script for label-triggered bumps - Update CONTRIBUTING.md with instructions on using the version bump script - Script supports patch/minor/major bumps and validates semantic versioning - CI will now check that module versions are properly updated in PRs
- Modify version-bump.sh to support both update and check modes - Add --check flag and 'check' command for validation without changes - Combine version-check and version-bump workflows into single workflow - Remove separate version-check.yaml workflow (was overcomplicated) - Update CONTRIBUTING.md to document simplified approach - Script now exits with proper codes: 0 for success, 1 for needs update - Workflow runs check job on all PRs, bump job only on labels - Much cleaner and simpler implementation as requested
…ks diff - Remove all check mode logic from version-bump.sh script - Script now only supports patch, minor, major (as requested) - Workflow runs script with patch and checks if diff exists - If diff exists, CI fails and tells user to add version label - Much simpler implementation: script updates, workflow checks diff - Updated documentation to remove check mode references - This is exactly what was requested: same script, check diff for validation
- Remove version-check job since it can't be required if it only runs on labels - Workflow now only triggers on 'labeled' events with version:patch|minor|major - This is the correct approach: workflow only runs when labels are applied - No required checks since the workflow is optional/manual via labels
…handling - Change permissions from 'write' to 'read' for contents - Remove unnecessary Git setup steps - Introduce a version check step to validate if module versions need updates - Update PR comment to guide users on required actions when versions are not up to date
I think we are good here if you wanna take a look @matifali |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge if you have tested it. I may not have time this week to test this.
I tested it a few times before hand, but let me run it one last time to make sure and then we can merge it I'll spin up a workspace to test this now. |
Extract Version Bump Logic into Reusable Script
This PR extracts the version bump logic from the GitHub Actions workflow (PR #137) into a reusable script and implements the requirements as requested.
✅ What This PR Delivers
🔧 Version Bump Script:
.github/scripts/version-bump.sh
patch
,minor
, andmajor
version bumpsorigin/main
)🔍 Version Check Workflow:
.github/workflows/version-check.yaml
🚀 Version Bump Workflow:
.github/workflows/version-bump.yaml
version:patch
,version:minor
,version:major
)📚 Updated Documentation:
CONTRIBUTING.md
🎯 Key Features
✅ Script Logic Extracted: All complex bash logic moved from workflow to reusable script
✅ Required CI Check: Version check workflow ensures versions are updated
✅ Diff Verification: Script checks git diff to detect modified modules
✅ Contribution Docs Updated: Clear instructions for contributors
✅ Backward Compatible: Maintains all original functionality
✅ Error Handling: Comprehensive validation and clear error messages
📖 Usage Examples
🔄 Workflow Integration
🧪 Testing
The script has been tested with:
This implementation addresses all the original requirements while making the logic more maintainable and reusable.